{% extends 'admin-v2/layout.html.twig' %}
{% set menu = 'admin_v2_classroom_manage' %}
{% set script_controller='topxiaadminbundle/controller/classroom/classroom' %}

{% block main %}
  <form id="message-search-form" class="form-inline well well-sm" action="" method="get" novalidate>
    {% include 'org/org-tree-select.html.twig' with {orgCode: app.request.get('orgCode'), modal: 'list'} %}

    <div class="form-group">
      <input class="form-control" type="text"
             placeholder="{{ 'admin.classroom_manage.manage.name_placeholder'|trans({'%name%':setting('classroom.name')|default('classroom'|trans)}) }}"
             name="titleLike" value="{{ app.request.get('titleLike') }}">
    </div>

    <button class="btn btn-primary">{{ 'form.btn.search'|trans }}</button>
    {% include 'admin-v2/widget/tooltip-widget.html.twig' with { icon: 'glyphicon-question-sign', content: 'admin.classroom_manage.manage.describe_tips'|trans|raw, placement: 'left'} %}

  </form>

  <p class="text-muted">
    <span
        class="mrl">{{ 'admin.classroom_manage.manage.count'|trans({'%courseNum%':classroomStatusNum.total})|raw }}</span>
    <span
        class="mrl">{{ 'admin.classroom_manage.manage.published_count'|trans({'%publishedNum%':classroomStatusNum.published})|raw }}</span>
    <span
        class="mrl">{{ 'admin.classroom_manage.manage.closed_count'|trans({'%closedNum%':classroomStatusNum.closed})|raw }}</span>
    <span
        class="mrl">{{ 'admin.classroom_manage.manage.unpublish_count'|trans({'%unPublishedNum%':classroomStatusNum.draft})|raw }}</span>
  </p>

  {% if classroomInfo %}
    <table class="table table-striped table-hover 111" id="classroom-table">
      <thead>
      <tr>
        {% if setting('magic.enable_org','0') %}
          <th><input type="checkbox" data-role="batch-select"></th>
        {% endif %}
        <th>{{ 'admin.classroom_manage.manage.number_th'|trans({'%title%':setting('calssroom.title')|default('classroom'|trans)}) }}</th>
        <th width="22%">{{ 'admin.classroom_manage.manage.name_th'|trans({'%name%':setting('classroom.name')|default('classroom'|trans)}) }}</th>
        {% include 'org/parts/table-thead-tr.html.twig' %}
        <th>{{ 'admin.classroom_manage.manage.course_number_th'|trans }}</th>
        <th>{{ 'admin.classroom_manage.manage.student_number_th'|trans }}</th>
        <th width="12%">{{ 'admin.classroom_manage.manage.price_th'|trans }}</th>
        <th>{{ 'admin.classroom_manage.manage.status_th'|trans }}</th>
        <th>{{ 'admin.classroom_manage.manage.operate_th'|trans }}</th>
      </tr>
      </thead>
      <tbody>

      {% for classroom in classroomInfo %}
        {% set category = categories[classroom.categoryId]|default(null) %}
        {% include 'admin-v2/teach/classroom/table-tr.html.twig' with {classroom:classroom,category:category} %}

      {% endfor %}

      </tbody>

    </table>
  {% else %}
    <div
        class="empty">{{ 'admin.classroom_manage.manage.empty'|trans({'%name%':setting('classroom.name')|default('classroom'|trans)}) }}</div>
  {% endif %}
  {% include 'org/batch-update-org-btn.html.twig' with {module:'classroom', formId:'classroom-table'} %}
  <div>
    {{ admin_macro.paginator(paginator) }}
  </div>
{% endblock %}